<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    html,
    body {
        width: 100%;
        height: 100%;
    }

    .container {
        width: 100%;
        height: 100%;
    }

    .light {
        background-color: #f3f3f3;
        color: #333;
    }

    .dark {
        background-color: #333;
        color: #f3f3f3;
    }
</style>

<body>
    <div class="container light">
        这是一大段话. <br>
        这是一大段话. <br>
        这是一大段话. <br>
        这是一大段话. <br>
    </div>

</body>
<script>
    let d = document.querySelector('div');
    d.onclick = () =>{
        if(d.className.indexOf('light') != -1){
            d.className = 'container dark'
        }else{
            d.className = 'container light'
        }
    }
</script>
</html>